// 将图片名集合用逗号分开组成字符串如[n1,n2,n3] => n1,n2,n3
export const listToStrs = (list) => {
  var imgs = ''
  list.forEach(key => {
    imgs += key.name + ','
  })

  // imgs += file.response.key + ','
  imgs = imgs.substring(0, imgs.length - 1)
  return imgs
}

// 将图片名结合域名前缀组合成图片地址集合
export const strsToList = (strs, domain) => {
  var list = []
  if (strs) {
    strs.split(',').forEach(key => {
      if (key!= null && key != ""){
        list.push({ name: key, url: domain + key })
      }
    })
  }
  return list
}
